<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="Cache-Control" content="no-cache"/>
    <meta http-equiv="Cache-Control" content="no-store"/>
    <meta http-equiv="Expires" content="0"/>
    <link rel="shortcut icon" type="image/x-icon" th:href="@{/static/favicon2.ico}">
    <link rel="stylesheet" th:href="@{/static/plugins/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/static/css/layout.css}">
    <link rel="stylesheet" th:href="@{/static/css/common.css}">
    <style>
        .page-content {
            padding: 10px;
        }
        .must:after{
            content: "*";
            color: red;
        }
    </style>
</head>
<body>
<div class="page-content">
    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label must">姓名</label>
            <div class="layui-input-block">
                <input type="hidden" name="employeeId" th:value="${employee.id}">
                <input type="hidden" name="userId" th:value="${user.id}" id="userId">
                <input type="text" name="userName" maxlength="20" lay-verify="required" placeholder="请输入姓名"
                       autocomplete="off" class="layui-input" readonly="readonly" th:value="${employee.name}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label must">登陆账号</label>
            <div class="layui-input-block">
                <input  th:if="${user.userCode !=null && user.userCode !=''}"  type="text" name="userCode" maxlength="16" lay-verify="userCode"  readonly="readonly" th:value="${user.userCode}" placeholder="请输入登陆名" class="layui-input">
                <input th:if="${user.userCode ==null ||  user.userCode ==''}" type="text" name="userCode" maxlength="16" lay-verify="userCode"  placeholder="请输入登陆名"  class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label  th:if="${user.password !=null && user.password !=''}" class="layui-form-label ">密码</label>
            <label  th:if="${user.password ==null || user.password ==''}" class="layui-form-label must">密码</label>
            <div class="layui-input-block">
                <input  th:if="${user.password !=null && user.password !=''}"  type="password" name="password" maxlength="16" lay-verify="pasw" placeholder="请输入密码" autocomplete="new-password" class="layui-input">
                <input th:if="${user.password ==null ||  user.password ==''}" type="password" name="password" maxlength="16" lay-verify="required|pasw" placeholder="请输入密码" autocomplete="new-password" class="layui-input">
            </div>
            <div th:if="${user.password !=null && user.password !=''}" style="font-size: 12px;color:#b2b2b2;margin-top:0;padding-left:115px;">如需修改密码，请从新填写，不填则不修改</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label must">手机号码</label>
            <div class="layui-input-block">
                <input th:if="${user.phone !=null && user.phone!=''}" type="text" name="phone" maxlength="11" lay-verify="phone|ph" id="phone" placeholder="请输入手机号码" autocomplete="off" class="layui-input" th:value="${user.phone}">
                <input  th:if="${user.phone ==null || user.phone==''}" type="text" name="phone" maxlength="11" lay-verify="phone|ph"  id="phone" placeholder="请输入手机号码" autocomplete="off" class="layui-input" th:value="${employee.contactPhone}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label must">角色</label>
            <div class="layui-input-block">
                <select id="roleId" name="roleId" lay-filter="roleId" lay-verify="required" readonly="请选择角色">
                    <option></option>
                    <option th:if="${user.roleId !=null && user.roleId!=''}" th:each="role:${roles}" th:value="${role.id}" th:text="${role.name}" th:selected="${user.roleId} eq ${role.id}"></option>
                    <option th:if="${user.roleId ==null || user.roleId ==''}" th:each="role:${roles}" th:value="${role.id}" th:text="${role.name}"></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否启用</label>
            <div class="layui-input-block">
                <input lay-filter="ck"   th:checked="${user.status==1 or user.userCode == null}" type="checkbox" name="status" lay-skin="switch" lay-text="启用|禁用"  value="1" >
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn  layui-btn-normal" lay-submit lay-filter="submitBtn">保存</button>
            </div>
        </div>
    </form>

</div>
<script th:src="@{/static/plugins/jquery.js}"></script>
<script th:src="@{/static/plugins/layui/layui.js}"></script>
<script th:src="@{/static/js/common.js}"></script>
<script th:src="@{/static/js/baseinfo/employee/loginSetting.js}"></script>
</body>

</html>